# date： week07

names_网新1 =["mike","mary","jan","jack"]
names_网新2 =["xiaomi","vivo","oppo"]
# 4. 删除列表
# names.clear()
# 清空，清除列表
# print(name)


# 5.合并列表  extend是有顺序的，() 里面的list排在后面
names_网新2.extend(names_网新1)
print(names_网新2)



# 6. copy() 复制列表  赋值 不等于 真正意义的复制
# names_网新1复制 = names_网新1
# print(names_网新1)
# print(names_网新1复制)
# names_网新1.append("youge")
# print("names_网新1:",names_网新1)
# print("names_网新1复制:",names_网新1复制)

# 引入copy()

# names_网新1_源数据备份 = names_网新1.copy()
# print(names_网新1)
# print(names_网新1_源数据备份)
# names_网新1.append("youge")
# print("names_网新1:",names_网新1)
# print("names_网新1_copy:",names_网新1_源数据备份)

# 用切片 [:] 等价于 copy()方法
names_网新1_源数据备份 = names_网新1[:]
print(names_网新1)
print(names_网新1_源数据备份)
names_网新1.append("youge")
print("names_网新1:",names_网新1)
print("names_网新1_源数据备份:",names_网新1_源数据备份)

stu_id = [95,97,90,90,97,88,90]
# 7. count() 查看元素出现的次数/统计数量
print(stu_id.count(90))

# 8. sort() 排序 reverse=True 从高到低，默认从低到高排序
stu_id.sort(reverse=True)
print(stu_id)

names_网新1.sort() # 字符串排序方法是 ： 首字母的a-z顺序
print(names_网新1)
